package com.health.common;

public enum ResultCode {
    NOT_RESORCE(404, "没有资源"),
    SERVER_EXCEPTION(500, "服务器异常"),
    ERROR(400, "请求失败"),
    UNAUTHORIZED(401, "未授权"),
    UNAUTHTICATION(403, "未认证"),
    AUTHTICATION_FAIL(2006, "认证失败"),
    SUCCESS(200, "响应成功"),
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_PASSWORD_ERROR(1002, "用户密码错误!"),
    CREATE_TOKEN_FAIL(2001, "创建token失败"),
    GET_CLAIM_FROM_TOKEN(2002, "token解析claims失败"),
    TOKEN_EXPIRED(2003, "token过期"),
    TOKEN_VERIFY_FAIL(2004, "token验证失败"),
    LOGIN_VERIFYCODE_EXPIRE(2004, "验证码失效"),
    LOGIN_VERIFY_ERROR(2005, "验证码错误");


    private Integer code;

    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "ResultCode{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
